#ifndef __DIR_H__
#define __DIR_H__

#include "my_head.h"

typedef struct path_s{
    char initPath[MAX_PATH_LEN];      // 不变初始真实根目录  初始化用
    char realPath[MAX_PATH_LEN];     // 当前真正路径
    char virtualPath[MAX_PATH_LEN];      // 当前虚拟路径
}path_t;

//初始化path结构体
int init_path(path_t *path);

//用于有登录系统后路径的初始化
int init_user_path(path_t *path, const char *username);

//获取规范路径
int makePath(path_t *path, const char *destDir, char *newVirPath, char *newRealPath);

// 目录操作函数声明
int handle_cd(path_t *path, const char *destDir, char *buf, int buf_len);
int handle_ls(path_t *path, const char *destDir, char *buf, int buf_len);
int handle_mkdir(path_t *path, const char *dirName, char *buf, int buf_len);
int handle_pwd(path_t *path, char *buf, int buf_len);
int handle_remove(path_t *path, const char *fileName, char *buf, int buf_len);
int handle_rmdir(path_t *path, const char *destDir, char *buf, int buf_len);

#endif // __DIR_H__
